﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using YJM.Modbus.Client.Models;
using YJM.Modbus.Client.Util;

namespace YJM.ModbusMonitor.GUI.Views
{
    /// <summary>
    /// DataMonitorView.xaml 的交互逻辑
    /// </summary>
    public partial class DataMonitorView : UserControl
    {
        public DataMonitorView()
        {
            InitializeComponent();
        }

        private void connectBt_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                //读取modbus.xml配置文件
                List<ModbusDeviceProperties> mdpl = ModbusConfigureHelper.readConfigure();
                //连接PLC


                this.connectBt.IsEnabled = false;
                this.disConnectBt.IsEnabled = true;
            }
            catch (Exception)
            {
                throw;
            }

        }

        private void disConnectBt_Click(object sender, RoutedEventArgs e)
        {
            this.disConnectBt.IsEnabled = false;
            this.connectBt.IsEnabled = true;
        }
    }
}
